/*
 * Copyright (C) Michael Martin & Antonio Carrozzini (TBJD)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package org.tbjd.client.interfaces;

import com.google.gwt.user.client.ui.Widget;

/**
 * A BorderListener is part of the border detection system. The BorderListener is notified by a
 * {@link org.tbjd.client.interfaces.BorderNotifier BorderNotifier} when a border event is detected.
 * 
 * @author Michael Martin
 * @author Antonio Carrozzini
 * @version 1.0
 * @see org.tbjd.client.interfaces.BorderNotifier
 * @see org.tbjd.client.interfaces.BorderTrigger
 */
public interface BorderListener {

	/**
	 * <p>
	 * This method is called from a {@link org.tbjd.client.interfaces.BorderNotifier BorderNotifier} while the mouse remains in active zones either by
	 * dragging or hovering one of them.
	 * </p>
	 * 
	 * If the mouse is just hovering a zone without dragging anything, then its value is null otherwise, the dragged object is the value.
	 * 
	 * @param draggable
	 *            is the widget currently being dragged. Null if it's a simple mouse move.
	 * @param directionX
	 *            is the x coordinate the children should move to.
	 * @param directionY
	 *            is the y coordinate the children should move to.
	 */
	public void executeBorderDetected(Widget draggable, int directionX, int directionY);

}
